/*
 * @Autor: Ruohong Yu
 * @Date: 2023-04-01 12:42:38
 * @Description: file content
 * @FilePath: \ebookd:\program\vsc\ebook\node-ebook\routes\userinfo.js
 */
const express = require('express')
const router = express.Router()
const userinfo_handler = require('../router_handler/userinfo')
const expressJoi = require('@escook/express-joi')
const { update_userinfo_schema, update_password_schema, update_avatar_schema } = require('../schema/user')

router.post('/sendemailcode',userinfo_handler.sendEmailCode)
// 更新用户信息的路由
router.post('/my/userinfo', expressJoi(update_userinfo_schema), userinfo_handler.updateUserInfo)
// 更新密码的路由
router.post('/updatepwd', expressJoi(update_password_schema), userinfo_handler.updatePassword)
// 更换头像的路由
router.post('/my/update/avatar', userinfo_handler.updateAvatar)

module.exports = router
